<template>
  <div id="app-container" style="padding:30px;">
  <el-form label-width="130px">
    <el-form-item label="版权名称">
      <el-select v-model="copyrightin.copyrightId" placeholder="请选择">
        <el-option
          v-for="list in AllList"
          :key="list.id"
          :label="list.copyrightName"
          :value="list.id">
        </el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="姓名">
      <el-col :span="5">
        <el-input v-model="copyrightin.name"/>
      </el-col>
    </el-form-item>
    <el-form-item label="手机号">
      <el-col :span="5">
        <el-input v-model="copyrightin.telephone"/>
      </el-col>
    </el-form-item>
    <!-- TODO 分类 -->
    <!-- TODO 版权 -->
    <!-- TODO 批次 -->
    <!-- TODO 书单 -->
    <el-form-item label="出生日期">
      <el-date-picker
        v-model="copyrightin.birthday"
        type="datetime"
        placeholder="选择时间"
        value-format="yyyy-MM-dd HH:mm:ss"
        default-time="00:00:00"
      />
    <el-form-item label="性别">
      <el-select v-model="copyrightin.sex" clearable placeholder="请选择">
        <el-option :value="1" label="男 "/>
        <el-option :value="0" label="女"/>
      </el-select>
    </el-form-item>
      <el-form-item label="座机号">
        <el-col :span="5">
          <el-input v-model="copyrightin.phone"/>
        </el-col>
      </el-form-item>
      <el-form-item label="公司地址">
        <el-col :span="5">
          <el-input v-model="copyrightin.address"/>
        </el-col>
      </el-form-item>
      <el-form-item label="邮箱">
        <el-col :span="5">
          <el-input v-model="copyrightin.email"/>
        </el-col>
      </el-form-item>
      <el-form-item label="备注">
        <el-col :span="5">
          <el-input v-model="copyrightin.remark"/>
        </el-col>
      </el-form-item>
    <!-- TODO 书封 -->
    <el-form-item>
      <el-button :disabled="saveBtnDisabled" type="primary" @click="saveMan()">保存</el-button>
    </el-form-item>
      <router-link :to="'/copyrightin/copyrightin/list/'">
        <el-button type="primary">返回</el-button>
      </router-link>
    </el-form-item>
  </el-form>
  </div>
</template>

<script>
  import copyrightin from '@/api/copyrightin/copyrightin.js'
    export default {
       data(){
         return{
           copyrightin:{},
           ManQuery: {},
           AllList:null,
           saveBtnDisabled:false,
           BASE_API: process.env.VUE_APP_BASE_API
         }
       },
      created() {
       this.findAll()
      },
      methods:{
         saveMan(){
           this.saveBtnDisabled=true
           copyrightin.saveMan(this.copyrightin)
           .then(response=>{
             this.$message({
               type:'success',
               message:'添加成功'
             })
             // this.$router.push('/copyrightin/copyrightin/ManList/')
           })
         },
        findAll(){
           copyrightin.findAllcopyright()
          .then(response =>{
            this.AllList=response.data.list
            console.log(this.AllList)
          })
        }
      }
    }
</script>

<style scoped>

</style>
